<template>
    <div class="container">

        <Row class="btn-action">
            <Col span="24">
              <Button type="primary" class="mp10" :loading="loading" @click="exportData()"><Icon type="ios-download-outline"></Icon>导出数据</Button>
            </Col>
        </Row>

        <div class="opt-area-02">
            <div class="left-con">
                录入总数: <span>{{countData.fcnum}} 条</span>
            </div>
            <div class="right-con">
<!--                <div class="input-frame">-->
<!--                    <Select v-model="params.hot" placeholder="发热状态" @on-change="selectlist">-->
<!--                        <Option value="">全部</Option>-->
<!--                        <Option value="0">未发热</Option>-->
<!--                        <Option value="1">发热</Option>-->
<!--                    </Select>-->
<!--                </div>-->
                <div class="input-frame" style="width: 164px">
                    <Input type="text" @on-click="selectlist(1)" placeholder="请输入姓名" style="width: 164px" v-model="params.name"
                           icon="ios-search"/>
                </div>
                <div class="input-frame" style="width: 164px">
                    <Input type="text" @on-click="selectlist(1)" placeholder="请输入身份证号" style="width: 164px" v-model="params.card_no"
                           icon="ios-search"/>
                </div>
                <div class="input-frame" style="width: 164px">
                    <Input type="text" @on-click="selectlist(1)" placeholder="请输入联系方式" style="width: 164px" v-model="params.tel"
                          icon="ios-search"/>
                </div>
              <div class="input-frame" v-if="companyCode === 'LM'" style="width: 164px">
                <Select v-model="params.area1" placeholder="区/县" style="width: 164px" filterable @on-change="perChange(1)">
                  <Option v-for="obj in addressInfo.list1" :value="obj.title" :key="obj.id">{{obj.title}}</Option>
                </Select>
              </div>
              <div class="input-frame" v-if="companyCode === 'LM'" style="width: 164px">
                <Select v-model="params.area2" placeholder="街道" style="width: 164px" filterable @on-change="perChange(2)">
                  <Option v-for="obj in addressInfo.list2" :value="obj.title" :key="obj.id">{{obj.title}}</Option>
                </Select>
              </div>
              <div class="input-frame" v-if="companyCode === 'LM'" style="width: 164px">
                <Select v-model="params.area3" placeholder="社区" style="width: 164px" filterable>
                  <Option v-for="obj in addressInfo.list3" :value="obj.title" :key="obj.id">{{obj.title}}</Option>
                </Select>
              </div>
                <Button type="info" size="small" @click="selectlist(1)" style="margin-top: 5px">搜索</Button>
            </div>
            <div class="right-con">
                <div class="input-frame" style="width: 164px">
                  <Select v-model="params.arrive_address_type" placeholder="来沈前经过地" filterable>
                    <Option v-for="obj in dictList" :value="obj.value" :key="obj.id">{{obj.label}}</Option>
                  </Select>
                </div>
                <div class="input-frame" style="width: 164px">
                  <Select v-model="params.user_control_type1" @on-change="changeuserControlType1()" placeholder="人员类型（一级）">
                    <Option v-for="obj in userControlType1" :value="obj.value" :key="obj.id">{{obj.label}}</Option>
                  </Select>
                </div>
                <div class="input-frame" style="width: 164px" v-if="userControlType2.length > 0">
                  <Select v-model="params.user_control_type2"  placeholder="人员类型（二级）">
                    <Option v-for="obj in userControlType2" :value="obj.value" :key="obj.id">{{obj.label}}</Option>
                  </Select>
                </div>
                <div class="input-frame" style="width: 164px" v-if="params.user_control_type1 === '2'">
                  <Select v-model="params.follow_person" placeholder="密接相关人" style="width: 164px">
                    <Option v-for="obj in followPersonList" :value="obj.value" :key="obj.id">{{obj.label}}</Option>
                  </Select>
                </div>
                <div class="input-frame" style="width: 164px">
                  <Select v-model="params.isfollow" placeholder="密切接触人群" @on-change="selectlist" style="width: 164px">
                    <Option value="">全部</Option>
                    <Option value="0">否</Option>
                    <Option value="1">是</Option>
                    <Option value="2">按行动轨迹主动申请隔离人员</Option>
                  </Select>
                </div>
                <!-- <div class="input-frame" style="width: 164px" v-if="params.isfollow=='1'">
                  <Select v-model="params.follow_person" placeholder="密接相关人" style="width: 164px">
                    <Option v-for="obj in follow_personList" :value="obj.value" :key="obj.id">{{obj.label}}</Option>
                  </Select>
                </div> -->
                <div class="input-frame" style="width: 164px" v-if="params.isfollow=='1'">
                  <Select v-model="params.follow_level" placeholder="密接等级" @on-change="selectlist" style="width: 164px">
                    <Option value="">全部</Option>
                    <Option value="1">一级</Option>
                    <Option value="2">二级</Option>
                    <Option value="3">三级</Option>
                  </Select>
                </div>
                <!-- <div class="input-frame" style="width: 164px">
                  <Select v-model="params.illness_state" placeholder="人员状态" @on-change="selectlist" style="width: 164px">
                    <Option value="">全部</Option>
                    <Option value="1">疑似病例</Option>
                    <Option value="2">确诊病例</Option>
                    <Option value="3">死亡</Option>
                    <Option value="4">治愈</Option>
                    <Option value="5">正常</Option>
                  </Select>
                </div> -->
                <!-- <div class="input-frame" style="width: 164px">
                  <Select v-model="params.inout_state" placeholder="离沈/入沈" @on-change="selectlist" style="width: 164px">
                    <Option value="">全部</Option>
                    <Option value="1">入沈人员</Option>
                    <Option value="2">离沈人员</Option>
                  </Select>
                </div> -->
                <div class="input-frame" style="width: 164px">
                  <Select v-model="params.supervise_start" placeholder="管控状态" filterable>
                    <Option v-for="obj in superviseDictList" :value="obj.value" :key="obj.id">{{obj.label}}</Option>
                  </Select>
                </div>
                <div class="input-frame" style="width: 164px">
                  <Select v-model="params.supervise_timeout" placeholder="预警状态">
                    <Option value="">全部</Option>
                    <Option value="0">正常</Option>
                    <Option value="1">预警</Option>
                  </Select>
                </div>
                <div class="input-frame" style="width: 164px" v-if="params.supervise_start == '1'">
                  <Select v-model="params.is_transfer" placeholder="居家隔离类型"  filterable>
                    <Option v-for="obj in is_transferList" :value="obj.value" :key="obj.id">{{obj.label}}</Option>
                  </Select>
                </div>
                <!-- <div class="input-frame" style="width: 164px">
                  <Select v-model="params.province2" placeholder="来沈前出发地省" filterable @on-change="chaneProv(2)" style="width: 164px">
                    <Option v-for="obj in inoutCity.provinceList" :value="obj.name" :key="obj.code">{{obj.name}}</Option>
                  </Select>
                </div>
                <div class="input-frame" style="width: 164px">
                  <Select v-model="params.city2" placeholder="来沈前出发地市" filterable style="width: 164px">
                    <Option v-for="obj in inoutCity.city2" :value="obj.name" :key="obj.code">{{obj.name}}</Option>
                  </Select>
                </div> -->
              <Button type="info" size="small" @click="cleanQuery()" style="margin-top: 5px">清空</Button>
            </div>
            <div class="right-con">
              <div class="input-frame" style="width: 164px">
                <Select v-model="params.olation_company_code" placeholder="录入区防指" style="width: 164px" filterable @on-change="perChange(1)">
                  <Option v-for="obj in addressInfo.list1" :value="obj.company_code" :key="obj.id">{{obj.title}}</Option>
                </Select>
              </div>
              <div class="input-frame" style="width: 164px">
                <Select v-model="params.nucleic_acid" placeholder="核酸检测" @on-change="selectlist" style="width: 164px">
                  <Option value="">全部</Option>
                  <Option value="0">未检测</Option>
                  <Option value="1">已检测</Option>
                </Select>
              </div>
              <div class="input-frame" style="width: 164px">
                <Select v-model="params.detection_1_result" placeholder="第一次结果" @on-change="selectlist" style="width: 164px">
                  <Option value="">全部</Option>
                  <Option value="1">阴性</Option>
                  <Option value="2">阳性</Option>
                  <Option value="3">待出结果</Option>
                  <Option value="4">未检测</Option>
                </Select>
              </div>
              <div class="input-frame" style="width: 164px">
                <Select v-model="params.detection_2_result" placeholder="第二次结果" @on-change="selectlist" style="width: 164px">
                  <Option value="">全部</Option>
                  <Option value="1">阴性</Option>
                  <Option value="2">阳性</Option>
                  <Option value="3">待出结果</Option>
                  <Option value="4">未检测</Option>
                </Select>
              </div>
              <div class="input-frame" style="width: 164px">
                <Select v-model="jzgl_day" placeholder="选择集中隔离时间" @on-change="selectlist" style="width: 164px">
                  <Option value="7">7天</Option>
                  <Option value="14">14天</Option>
                  <Option value="21">21天</Option>
                </Select>
              </div>
              <div class="input-frame" style="width: 164px">
                <Select v-model="params.is5day1" placeholder="剩余隔离时间小于5天" @on-change="selectlist" style="width: 164px">
                    <Option value="">全部</Option>
                    <Option value="">否</Option>
                    <Option value="1">是</Option>
                  </Select>
              </div>
            </div>
        </div>
        <Table :loading="countData.loading" border :columns="columns2" :data="fcDataList" size="small" ref="table">
            <template slot-scope="{ row }" slot="nucleic_acid">
              <span v-if="row.nucleic_acid == '0'">未检测</span>
              <span v-if="row.nucleic_acid == '1'">已检测</span>
            </template>
            <template slot-scope="{ row }" slot="isolation">
              <span v-if="row.isolation == '0'">未隔离</span>
              <span v-if="row.isolation == '1'">隔离</span>
            </template>
            <template slot-scope="{ row }" slot="detection_1_result">
            <span v-if="row.detection_1_result == '1'">阴性</span>
            <span v-if="row.detection_1_result == '2'" style="color: red">阳性</span>
            <span v-if="row.detection_1_result == '3'">待出结果</span>
            <span v-if="row.detection_1_result == '4'">未检测</span>
          </template>
          <template slot-scope="{ row }" slot="detection_2_result">
            <span v-if="row.detection_2_result == '1'">阴性</span>
            <span v-if="row.detection_2_result == '2'" style="color: red">阳性</span>
            <span v-if="row.detection_2_result == '3'">待出结果</span>
            <span v-if="row.detection_2_result == '4'">未检测</span>
          </template>
          <template slot-scope="{ row }" slot="follow_level">
            <span v-if="row.follow_level == '1'">一级密接</span>
            <span v-if="row.follow_level == '2'">二级密接</span>
            <span v-if="row.follow_level == '3'">三级密接</span>
          </template>
            <template slot-scope="{ row }" slot="illness_state">
              <span v-if="row.illness_state == '1'" style="color: red">疑似病例</span>
              <span v-if="row.illness_state == '2'" style="color: red">确诊病例</span>
              <span v-if="row.illness_state == '3'" style="color: red">死亡</span>
              <span v-if="row.illness_state == '4'" >治愈</span>
              <span v-if="row.illness_state == '5'" >正常</span>
            </template>
            <template slot-scope="{ row }" slot="inout_state">
              <span v-if="row.inout_state == '1'">入沈人员</span>
              <span v-if="row.inout_state == '2'">离沈人员</span>
            </template>
            <template slot-scope="{ row }" slot="paper_card">
              <span v-if="row.paper_card == '0'">没有</span>
              <span v-if="row.paper_card == '1'">有</span>
            </template>
            <template slot-scope="{ row }" slot="app_card">
              <span v-if="row.app_card == '0'">没有</span>
              <span v-if="row.app_card == '1'">有</span>
            </template>
<!--            <template slot-scope="{ row }" slot="hot">-->
<!--              <span v-if="row.hot == '1'" style="color: red">发热</span>-->
<!--              <span v-else>未发热</span>-->
<!--            </template>-->
          <template slot-scope="{ row }" slot="supervise_start">
            <span v-if="row.supervise_start == '1'">居家隔离</span>
            <span v-if="row.supervise_start == '2'">询访</span>
            <span v-if="row.supervise_start == '3'">离沈</span>
            <span v-if="row.supervise_start == '4'">集中转居家</span>
            <span v-if="row.supervise_start == '5'">居家转集中</span>
           <span v-if="row.supervise_start == '6'">解除隔离</span>
            <span v-if="row.supervise_start == '7'">集中隔离</span>
            <span v-if="row.supervise_start == '12'" style="color: red">送诊</span>
<!--            <span v-if="row.supervise_start == '7'">集中隔离</span>-->
<!--            <span v-if="row.supervise_start == '5'">居家转集中</span>-->
<!--            <span v-if="row.state == '2'">集中留观</span>-->
          </template>
          <template slot-scope="{ row }" slot="a">
            <div v-if="row.supervise_start == '7'&& row.jzgl_day!=='' && row.jzgl_day!==null &&row.jzgl_day!==undefined">
              <span v-if="parseInt(row.a)>1">正常</span>
              <span v-else style="color: red">预警</span>
            </div>
          </template>
            <template slot-scope="{ row }" slot="referral">
              <span v-if="row.referral == '1'">已送诊</span>
              <span v-else style="color: red">未送诊</span>
            </template>
            <template slot-scope="{ row }" slot="state">
              <span v-if="row.state == '1'">在家留观</span>
              <span v-if="row.state == '2'">集中留观</span>
            </template>
            <template slot-scope="{ row }" slot="isfollow">
              <span v-if="row.isfollow == '1'" style="color: red">是</span>
              <span v-else>否</span>
            </template>
<!--            <template slot-scope="{ row }" slot="arrive_address_type">-->
<!--              <span v-if="row.arrive_address_type == '1'" style="color: red">湖北武汉</span>-->
<!--              <span v-if="row.arrive_address_type == '2'" style="color: red">湖北其他城市</span>-->
<!--              <span v-if="row.arrive_address_type == '5'" style="color: red">浙江温州</span>-->
<!--              <span v-if="row.arrive_address_type == '6'" style="color: red">韩国</span>-->
<!--              <span v-if="row.arrive_address_type == '7'" style="color: red">日本</span>-->
<!--              <span v-if="row.arrive_address_type == '3'">其他省市</span>-->
<!--            </template>-->
            <template slot="action" slot-scope="{ row }">
                <Row style="margin-bottom: 5px; margin-top: 2px">
                    <Button class="table-action-btn" type="info" size="small" @click="showdetail(row, 'info', params.states)">详情</Button>
                    <Button class="table-action-btn" type="success" size="small" @click="showdetail(row, 'edit', params.states)">编辑</Button>
                    <Button class="table-action-btn" type="primary" size="small" @click="disisolation(row)">解除隔离</Button>
<!--                    <Button class="table-action-btn" v-if="params.user_type == '1' || params.user_type == '2'" type="info" size="small" @click="exchange(row)">转换</Button>-->
<!--                    <Button class="table-action-btn" type="primary" size="small" @click="temperature(row)">防治办法</Button>-->
                    <!-- <Button class="table-action-btn" type="info" size="small" @click="passCheck(row, 'paper')">纸质证</Button> -->
                </Row>
                <Row style="margin-bottom: 2px">
<!--                    <Button class="table-action-btn" type="success" size="small" @click="fever(row)">发热</Button>-->
                  <Button class="table-action-btn" type="primary" size="small" @click="leave(row)">离沈</Button>
                  <!-- <Button class="table-action-btn" type="warning" size="small" @click="Referral(row)">送诊</Button> -->
<!--                  <Button class="table-action-btn" type="error" size="small" @click="deleteRow(row)">删除</Button>-->
<!--                  <Button class="table-action-btn" type="info" size="small" @click="moveOut(row)">迁出</Button>-->
                  <Button class="table-action-btn" type="info" size="small" @click="JCGE(row)">隔离转居家</Button>
                  <Button class="table-action-btn" type="primary" size="small" @click="zsbj(row)">转市本级</Button>
                </Row>
                <Row style="margin-bottom: 2px">
                  <Button class="table-action-btn" type="info" size="small" @click="JKJC(row)">隔离转社区健康监测</Button>
                  <Button class="table-action-btn" type="primary" size="small" @click="ShowJKSF(row)">隔离转健康随访</Button>
                </Row>
                <Row style="margin-bottom: 2px">
                  <span v-if="row.supervise_start == '7'&& row.jzgl_day!=='' && row.jzgl_day!==null &&row.jzgl_day!==undefined && parseInt(row.yujing)<=1">
                      <Button class="table-action-btn" type="info" size="small" @click="YTS(row)">预推送</Button>
                  </span>
                  <Button class="table-action-btn" type="error" size="small" @click="ZWQZ(row)">转为送诊</Button>
                 <Button class="table-action-btn" type="info" size="small" @click="ZWJKGL(row)">隔离转自我健康管理</Button>
                  <!-- <Button class="table-action-btn" type="success" size="small" @click="passCheck(row, 'app')">电子证</Button> -->
                  <!-- <Button class="table-action-btn" type="primary" size="small" @click="quarantine(row)">隔离</Button> -->
                </Row>
            </template>
        </Table>
        <Row v-if="loadData == true">
          <Col class="demo-spin-col" span="8" offset="8">
            <Spin fix>
              <Icon type="ios-loading" size=18 class="demo-spin-icon-load"></Icon>
              <div>Loading</div>
            </Spin>
          </Col>
        </Row>
        <Row type="flex" justify="end" class="page_style">
          <Page :current="params.pageNo" :total="params.totalRecord" show-sizer :page-size="params.pageSize"
                show-total @on-change="pageAction" @on-page-size-change="pageSizeChange"/>
        </Row>
        <Modal v-model="modal1" title="发热情况" @on-ok="ok" @on-cancel="cancel">
            <RadioGroup v-model="hot">
              <Radio label="0">未发热</Radio>
              <Radio label="1">发热</Radio>
            </RadioGroup>
        </Modal>
        <Modal v-model="modal2" title="送诊情况" @on-ok="ok1" @on-cancel="cancel">
            <Row class="mb20">
              <Col span="5" offset="1" class="ivu-form-item-label">是否送诊：</Col>
              <Col span="8" class="ivu-form-item-content">
                <RadioGroup v-model="referralInfo.referral">
                  <Radio label="0">未送诊</Radio>
                  <Radio label="1">送诊</Radio>
                </RadioGroup>
              </Col>
            </Row>
            <Row class="mb20" v-if="referralInfo.referral == '1'">
              <Col span="5" offset="1" class="ivu-form-item-label">送诊医院：</Col>
              <Col span="8" class="ivu-form-item-content">
                <Select v-model="referralInfo.referral_address" placeholder="送诊医院" filterable style="width: 300px">
                  <Option v-for="obj in hospital_list" :value="obj.hospital_name" :key="obj.hospital_name">{{obj.hospital_name}}</Option>
                </Select>
              </Col>
            </Row>
        </Modal>
        <Modal v-model="modal4" title="离沈情况" @on-ok="ok2" @on-cancel="cancel">
          <Row class="mb20">
            <Col span="5" offset="1" class="ivu-form-item-label">是否离沈：</Col>
            <Col span="8" class="ivu-form-item-content">
              <RadioGroup v-model="modalInfo1.inout_state">
                <!-- <Radio label="1">来沈人员</Radio> -->
                <Radio label="2">离沈人员</Radio>
              </RadioGroup>
            </Col>
          </Row>
          <Row class="mb20" v-if="modalInfo1.inout_state == '2'">
            <Col span="5" offset="1" class="ivu-form-item-label">目的地：</Col>
            <Col span="7">
                <Select v-model="modalInfo1.province1" placeholder="省" filterable @on-change="change(1)" style="width: 140px">
                  <Option v-for="obj in cityInfo.list1" :value="obj.name" :key="obj.code">{{obj.name}}</Option>
                </Select>
            </Col>
            <Col span="6" offset="1">
                <Select v-model="modalInfo1.province2" placeholder="市" filterable style="width: 140px">
                  <Option v-for="obj in cityInfo.list2" :value="obj.name" :key="obj.id">{{obj.name}}</Option>
                </Select>
            </Col>
          </Row>
          <Row class="mb20" v-if="modalInfo1.inout_state == '2'">
            <Col span="5" offset="1" class="ivu-form-item-label">离沈时间：</Col>
            <Col span="8" class="ivu-form-item-content">
              <DatePicker type="datetime" placeholder="选择时间" v-model="modalInfo1.out_time" style="width: 300px" ></DatePicker>
            </Col>
          </Row>
          <Row class="mb20" v-if="modalInfo1.inout_state == '2'">
            <Col span="5" offset="1" class="ivu-form-item-label">离沈方式：</Col>
            <Col span="8" class="ivu-form-item-content">
              <Select v-model="modalInfo1.out_type" placeholder="请选择交通方式" style="width: 300px">
                <Option value="1">火车</Option>
                <Option value="2">轮船</Option>
                <Option value="3">飞机</Option>
                <Option value="4">大巴</Option>
                <Option value="5">自驾</Option>
              </Select>
            </Col>
          </Row>
          <Row class="mb20" v-if="modalInfo1.inout_state == '2'">
            <Col span="5" offset="1" class="ivu-form-item-label">交通方式备注：</Col>
            <Col span="8">
              <Input v-model="modalInfo1.out_type_remark" placeholder="交通方式备注" type="textarea" style="width: 300px"></Input>
            </Col>
          </Row>
          <Row v-if="modalInfo1.inout_state == '2'">
            <Col span="5" offset="1" class="ivu-form-item-label">备注：</Col>
            <Col span="8">
              <Input v-model="modalInfo1.isout_sheny_remark" placeholder="离沈后轨迹" type="textarea" style="width: 300px"></Input>
            </Col>
          </Row>
        </Modal>
        <Modal v-model="modal3" title="选择迁出到社区" @on-ok="saveCompany()" @on-cancel="cancel">
            <Form label-position="right" :label-width="100">
              <Row>
                <Col span="5" class="ivu-form-item-label">迁入社区：</Col>
                <Col span="16" class="ivu-form-item-content">
                  <Select v-model="modalStr" filterable>
                    <Option v-for="company in company_list" :value="JSON.stringify(company)"
                            v-bind:key="company.key">{{company.sq_name }}（{{company.code}}）</Option>
                  </Select>
                </Col>
              </Row>
            </Form>
        </Modal>
      <Modal v-model="modal22" title="选择转入社区" @on-ok="jiechuGL()" @on-cancel="cancel">
        <Form>
          <FormItem>
          <Row style="margin-bottom: 10px">
            <Col span="6"><span class="red-star">*</span>转入社区：</Col>
            <Col span="18" class="ivu-form-item-content">
              <Select v-model="modalStr" filterable style="width: 300px">
                <Option v-for="company in company_list" :value="JSON.stringify(company)"
                        v-bind:key="company.key">{{company.sq_name }}（{{company.code}}）</Option>
              </Select>
            </Col>
          </Row>
            <Row style="margin-bottom: 10px">
              <Col span="6"><span class="red-star">*</span>转运联系人：</Col>
              <Col span="18" class="ivu-form-item-content">
                <Input v-model="transfer_name" placeholder="请输入姓名" style="width: 300px" />
              </Col>
            </Row>
            <Row style="margin-bottom: 10px">
              <Col span="6"><span class="red-star">*</span>转运联系人电话：</Col>
              <Col span="18" class="ivu-form-item-content">
                <Input v-model="transfer_tel" placeholder="请输入电话号码" style="width: 300px" />
              </Col>
            </Row>
            <Row style="margin-bottom: 10px">
              <Col span="6"><span class="red-star">*</span>转运车辆车牌号：</Col>
              <Col span="18" class="ivu-form-item-content">
              <Input v-model="transfer_id" placeholder="请输入车牌号." style="width: 300px" />
              </Col>
            </Row>
            <Row style="margin-bottom: 10px">
              <Col span="6"><span class="red-star">*</span>转运时间：</Col>
              <Col span="18" class="ivu-form-item-content">
                <DatePicker v-model="transfer_time" type="datetime" format="yyyy-MM-dd HH:mm:ss" placeholder="选择转运时间" style="width: 200px"></DatePicker>
              </Col>
            </Row>
          </FormItem>
        </Form>
      </Modal>
      <Modal v-model="modaljksf" title="选择转入社区" @on-ok="jiechujksf()" @on-cancel="cancel">
        <Form>
          <FormItem>
          <Row style="margin-bottom: 10px">
            <Col span="6"><span class="red-star">*</span>转入社区：</Col>
            <Col span="18" class="ivu-form-item-content">
              <Select v-model="modalStr" filterable style="width: 300px">
                <Option v-for="company in company_list" :value="JSON.stringify(company)"
                        v-bind:key="company.key">{{company.sq_name }}（{{company.code}}）</Option>
              </Select>
            </Col>
          </Row>
            <Row style="margin-bottom: 10px">
              <Col span="6"><span class="red-star">*</span>转运联系人：</Col>
              <Col span="18" class="ivu-form-item-content">
                <Input v-model="transfer_name" placeholder="请输入姓名" style="width: 300px" />
              </Col>
            </Row>
            <Row style="margin-bottom: 10px">
              <Col span="6"><span class="red-star">*</span>转运联系人电话：</Col>
              <Col span="18" class="ivu-form-item-content">
                <Input v-model="transfer_tel" placeholder="请输入电话号码" style="width: 300px" />
              </Col>
            </Row>
            <Row style="margin-bottom: 10px">
              <Col span="6"><span class="red-star">*</span>转运车辆车牌号：</Col>
              <Col span="18" class="ivu-form-item-content">
              <Input v-model="transfer_id" placeholder="请输入车牌号." style="width: 300px" />
              </Col>
            </Row>
            <Row style="margin-bottom: 10px">
              <Col span="6"><span class="red-star">*</span>转运时间：</Col>
              <Col span="18" class="ivu-form-item-content">
                <DatePicker v-model="transfer_time" type="datetime" format="yyyy-MM-dd HH:mm:ss" placeholder="选择转运时间" style="width: 200px"></DatePicker>
              </Col>
            </Row>
          </FormItem>
        </Form>
      </Modal>
      <Modal v-model="modal33" title="选择转入社区" @on-ok="jiechuGL4()" @on-cancel="cancel">
        <Form>
          <FormItem>
          <Row style="margin-bottom: 10px">
            <Col span="6"><span class="red-star">*</span>转入社区：</Col>
            <Col span="18" class="ivu-form-item-content">
              <Select v-model="modalStr" filterable style="width: 300px">
                <Option v-for="company in company_list" :value="JSON.stringify(company)"
                        v-bind:key="company.key">{{company.sq_name }}（{{company.code}}）</Option>
              </Select>
            </Col>
          </Row>
          </FormItem>
        </Form>
      </Modal>
      <Modal v-model="modalYTS" title="选择预推送社区" @on-ok="yutuisong()" @on-cancel="cancel">
        <Form>
          <FormItem>
          <Row style="margin-bottom: 10px">
            <Col span="6"><span class="red-star">*</span>选择预推送社区：</Col>
            <Col span="18" class="ivu-form-item-content">
              <Select v-model="modalStr" filterable style="width: 300px">
                <Option v-for="company in company_list" :value="JSON.stringify(company)"
                        v-bind:key="company.key">{{company.sq_name }}（{{company.code}}）</Option>
              </Select>
            </Col>
          </Row>
          </FormItem>
        </Form>
      </Modal>
        <Modal v-model="modal5" title="设置隔离状态" @on-ok="saveQuarantine()" @on-cancel="cancel">
            <Form label-position="right" :label-width="100">
              <Row>
                <Col span="5" class="ivu-form-item-label">是否隔离</Col>
                <Col span="16" class="ivu-form-item-content" style="margin-top:6px">
                  <RadioGroup v-model="quarantineParam.isolation">
                      <Radio label="1">
                          <span>是</span>
                      </Radio>
                      <Radio label="0">
                          <span>否</span>
                      </Radio>
                  </RadioGroup>
                </Col>
              </Row>
            </Form>
        </Modal>
        <Modal v-model="modalCard" :title="titleCard" @on-ok="okCard" @on-cancel="cancel">
          <p style="margin-left: 90px; font-size: 1rem">{{checkCardTitle}}</p>
        </Modal>
      <template>
        <Modal
          v-model="disisolationModal"
          title="解除隔离"
          @on-ok="disisolationOk"
          @on-cancel="cancel">
          <p>是否解除隔离?</p>
        </Modal>
        <Modal
          v-model="ZWQZModal"
          title="转为送诊"
          @on-ok="ZWQZOk"
          @on-cancel="cancel">
          <p>是否转为送诊?</p>
        </Modal>
        <Modal
          v-model="zsbjModal"
          title="转入市本级"
          @on-ok="zsbjOk"
          @on-cancel="cancel">
          <p>是否转入市本级?</p>
        </Modal>
      </template>
    </div>
</template>

<script>
// userlist
import { findOlationExcelList, updateuserinfo, delbyid, createOutApplu, findOutAllList, /* getAllUserByMZList, */
  date0str, findAllHospitalList, getDictList, findOlationList, relieveIsolation, getAllUserByMZNotNCList, saveBeforehandSendInfo, updateInfoTOLM40013 } from '@/api/yi-qing-fang-kong'
import { grid_downlist } from '@/api/eventlist'
import { getCityList } from '@/api/common'
import saveparams from '@/view/yi-qing-fang-kong/saveparams.vue'
// import { forEach } from '@/libs/tools'
export default {
  name: 'yiQingListjz',
  data () {
    return {
      transfer_id: '',
      transfer_name: '',
      transfer_tel: '',
      transfer_time: '',
      disisolationModal: false,
      ZWQZModal: false,
      zsbjModal: false,
      quarantineParam: {
        id: ''
      },
      follow_personList: [],
      is_transferList: [],
      dateArr: [],
      dictList: [],
      superviseDictList: [],
      loadData: true,
      hospital_list: [],
      cityStr: '',
      cityInfo: { list1: [], list2: [] },
      cityList: [],
      modalInfo1: {
        inout_state: '',
        isout_sheny_remark: '',
        id: this.id
      },
      modal4: false,
      modalCard: false,
      titleCard: '',
      checkCardTitle: '',
      loading: false,
      fcAllDataList: [],
      modalStr: '',
      modalInfo: {
        in_company: '',
        user_id: '',
        out_company_name: '',
        in_company_name: ''
      },
      jzgl_day: '',
      type: this.$route.query.type, // 列表类型
      addressInfo: { list1: [], list2: [], list3: [] },
      inoutCity: { provinceList: [], city1: [], city2: [] },
      company_list: [],
      id: '',
      hot: '',
      referralInfo: {
        referral: '',
        referral_address: '',
        id: this.id
      },
      modal1: false,
      modal2: false,
      modal3: false,
      modal5: false,
      modal22: false,
      modal33: false,
      modalYTS: false,
      modaljksf: false,
      row: {},
      countData: { loading: false, fcnum: 0, ytbnum: 0, zcnum: 0 },
      params: {
        jzgl_day: '',
        name: '',
        type: '',
        pageNo: 1,
        pageSize: 10,
        totalRecord: 0,
        state: '',
        area1: '',
        area2: '',
        area3: '',
        arrive_address_type: '',
        hot: '',
        isfollow: '',
        user_type: '',
        inout_state: '',
        originate_province: '',
        originate_city: '',
        states: '',
        nucleic_acid: '',
        isolation: '',
        supervise_start: '',
        olation_company_code: '',
        card_no: '',
        tel: '',
        follow_person: '',
        follow_level: '',
        is_transfer: '',
        supervise_timeout: '',
        detection_1_result: '',
        detection_2_result: ''
      },
      columns2: [
        { title: '姓名', key: 'NAME', width: 100, align: 'center', fixed: 'left' },
        { title: '联系方式', key: 'tel', width: 120, align: 'center' },
        { title: '身份证号', key: 'card_no', width: 160, align: 'center' },
        { title: '性别', key: 'sex', width: 80, align: 'center' },
        // { title: '核酸检测', slot: 'nucleic_acid', width: 100, align: 'center' },
        // { title: '第一次检测结果', slot: 'detection_1_result', width: 100, align: 'center' },
        // { title: '第二次检测结果', slot: 'detection_2_result', width: 100, align: 'center' },
        // { title: '隔离状态', slot: 'isolation', width: 100, align: 'center' },
        // { title: '人员状态', slot: 'illness_state', width: 100, align: 'center' },
        // { title: '离沈状态', slot: 'inout_state', width: 100, align: 'center' },
        { title: '管控状态', slot: 'supervise_start', width: 100, align: 'center' },
        { title: '居家隔离状态', key: 'is_transfer', width: 100, align: 'center' },
        { title: '集中隔离开始日期', key: 'olation_time', width: 200, align: 'center' },
        { title: '集中隔离天数', key: 'jzgl_day', width: 200, align: 'center' },
        { title: '预警状态', slot: 'a', width: 200, align: 'center' },
        // { title: '发热状态', slot: 'hot', width: 100, align: 'center' },
        // { title: '送诊状态', slot: 'referral', width: 100, align: 'center' },
        // { title: '隔离状态', slot: 'state', width: 100, align: 'center' },
        // { title: '纸质证', slot: 'paper_card', width: 80, align: 'center' },
        // { title: '电子证', slot: 'app_card', width: 80, align: 'center' },
        { title: '密切接触人群(是/否)', slot: 'isfollow', width: 100, align: 'center' },
        { title: '密接相关人', key: 'follow_person', width: 100, align: 'center' },
        { title: '密接等级', slot: 'follow_level', width: 100, align: 'center' },
        // { title: '剩余安全观察期日期', key: 'safe_date', width: 150, align: 'center' },
        { title: '来沈前经过地', key: 'arrive_address_type1', width: 120, align: 'center' },
        { title: '来沈前出发地省', key: 'originate_province', width: 130, align: 'center' },
        { title: '来沈前出发地市', key: 'originate_city', width: 130, align: 'center' },
        { title: '区、县(市)', key: 'area', width: 80, align: 'center' },
        { title: '街道(乡镇)', key: 'street', width: 80, align: 'center' },
        { title: '社区(村)', key: 'community', width: 100, align: 'center' },
        { title: '录入社区', key: 'company_name', width: 100, align: 'center' },
        { title: '录入区防指', key: 'olation_company_name', width: 100, align: 'center' },
        { title: '录入时间', key: 'create_time', width: 200, align: 'center' },

        { title: '来沈时间', key: 'arrive_time', width: 200, align: 'center' },
        { title: '具体地址', key: 'address1', minWidth: 250, align: 'center' },
        { title: '操作', align: 'center', width: 270, slot: 'action', fixed: 'right' }
      ],
      columns3: [
        { title: '姓名', key: 'NAME', width: 100, align: 'center', fixed: 'left' },
        { title: '联系方式', key: 'tel', width: 120, align: 'center' },
        { title: '身份证号', key: 'card_no', width: 160, align: 'center' },
        { title: '性别', key: 'sex', width: 80, align: 'center' },
        { title: '核酸检测', key: 'nucleic_acid', width: 100, align: 'center' },
        { title: '管控状态', key: 'supervise_start', width: 100, align: 'center' },
        // { title: '纸质证', key: 'paper_card', width: 80, align: 'center' },
        // { title: '电子证', key: 'app_card', width: 80, align: 'center' },
        { title: '密切接触人群(是/否)', key: 'isfollow', width: 100, align: 'center' },
        { title: '来沈前经过地', key: 'arrive_address_type', width: 120, align: 'center' },
        { title: '来沈前出发地省', key: 'originate_province', width: 130, align: 'center' },
        { title: '来沈前出发地市', key: 'originate_city', width: 130, align: 'center' },
        { title: '区、县(市)', key: 'area', width: 80, align: 'center' },
        { title: '街道(乡镇)', key: 'street', width: 80, align: 'center' },
        { title: '社区(村)', key: 'community', width: 100, align: 'center' },
        { title: '录入社区', key: 'company_name', width: 100, align: 'center' },
        { title: '录入区防指', key: 'olation_company_name', width: 100, align: 'center' },
        { title: '录入时间', key: 'create_time', width: 200, align: 'center' },
        { title: '来沈时间', key: 'arrive_time', width: 200, align: 'center' },
        { title: '具体地址', key: 'address', minWidth: 250, align: 'center' }
      ],
      columns1: [
        { title: '姓名', key: '姓名', width: 100, align: 'center' },
        { title: '性别', key: '性别', width: 160, align: 'center' },
        { title: '送诊', key: '送诊', width: 80, align: 'center' },
        { title: '送诊地址', key: '送诊地址', width: 80, align: 'center' },
        { title: '发热', key: '发热', width: 80, align: 'center' },
        { title: '证件类型', key: '证件类型', width: 100, align: 'center' },
        { title: '证件号', key: '证件号', width: 120, align: 'center' },
        { title: '街道', key: '街道', width: 100, align: 'center' },
        { title: '联系方式', key: '联系方式', width: 120, align: 'center' },
        { title: '包保人联系方式', key: '包保人联系方式', width: 120, align: 'center' },
        // { title: '人员状态', key: '人员状态', width: 160, align: 'center' },
        // { title: '人员状态备注', key: '人员状态备注', width: 160, align: 'center' },
        { title: '区/县', key: '区/县', width: 120, align: 'center' },
        { title: '社区', key: '社区', width: 80, align: 'center' },
        { title: '具体地址', key: '具体地址', width: 200, align: 'center' },
        { title: '留观', key: '留观', width: 80, align: 'center' },
        { title: '来沈时间', key: '来沈时间', width: 80, align: 'center' },
        { title: '交通方式', key: '交通方式', width: 80, align: 'center' },
        { title: '来沈后活动路径', key: '来沈后活动路径', minWidth: 250, align: 'center' },
        { title: '来沈前经过地类型', key: '来沈前经过地类型', minWidth: 250, align: 'center' },
        { title: '来沈前经过地', key: '来沈前经过地', width: 120, align: 'center' },
        { title: '同行人员', key: '同行人员', width: 120, align: 'center' },
        { title: '接触人员', key: '接触人员', width: 120, align: 'center' },
        { title: '填写时间', key: '填写时间', minWidth: 100, align: 'center' },
        { title: '机构名称', key: '机构名称', minWidth: 100, align: 'center' },
        { title: '机构编号', key: '机构编号', width: 200, align: 'center' },
        { title: '是否删除', key: '是否删除', width: 200, align: 'center' }
      ],
      fcDataList: [],
      userControlType2: [],
      userControlType1: [],
      followPersonList: []
    }
  },
  computed: {
    companyCode () {
      return this.$store.state.user.severUserInfo.company_code
    }
  },
  watch: {
    $route: function (to, from) {
      console.log(this.$route.query.type, to, '!@!@#@')
      if (to.query.type) {
        this.type = to.query.type
      }
      if (to.query.user_type) {
        this.params.user_type = to.query.user_type
      }
      if (to.query.states) {
        this.params.states = to.query.states
      }
      console.log(this.params, '入参')
      this.selectlist()
    }
  },
  methods: {
    exportData () {
      this.loading = true
      let dataList = []
      findOlationExcelList().then(ret => {
        if (ret.data.errcode === 0) {
          dataList = ret.data.data
          console.log(dataList)
          this.$refs.table.exportCsv({
            filename: '疫情监控人员信息',
            columns: this.columns3,
            data: dataList,
            original: false
          })
          this.loading = false
        }
      })
    },
    disisolation (row) {
      this.disisolationModal = true
      this.id = row.id
    },
    disisolationOk () {
      this.modalInfo = {
        id: this.id,
        supervise_start: '6'
      }
      console.log(this.modalInfo)
      relieveIsolation(this.modalInfo).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '解除隔离成功'
          })
          this.disisolationModal = false
          this.selectlist()
        } else {
          this.$Notice.error({
            title: '失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    ZWQZ (row) {
      this.ZWQZModal = true
      this.id = row.id
    },
    ZWQZOk () {
      this.modalInfo = {
        id: this.id,
        supervise_start: '12'
      }
      console.log(this.modalInfo)
      relieveIsolation(this.modalInfo).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '转为确诊成功'
          })
          this.ZWQZModal = false
          this.modalInfo = {}
          this.selectlist()
        } else {
          this.$Notice.error({
            title: '失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    zsbj (row) {
      this.zsbjModal = true
      this.id = row.id
    },
    zsbjOk () {
      this.modalInfo = {
        id: this.id
      }
      console.log(this.modalInfo)
      updateInfoTOLM40013(this.modalInfo).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '转为市本级成功'
          })
          this.zsbjModal = false
          this.modalInfo = {}
        } else {
          this.$Notice.error({
            title: '失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    pageAction (page) {
      this.params.pageNo = page
      this.getList()
    },
    selectlist (inpageNo) {
      if (inpageNo) {
        this.params.pageNo = inpageNo
      } else if (saveparams.info.listjz) {
        this.params.pageNo = saveparams.info.listjz.pageNo
      } else {
        this.params.pageNo = 1
      }
      if (this.type) {
        this.params.type = this.type
      }
      if (this.params.area1 === '全部') {
        this.params.area = ''
      } else {
        this.params.area = this.params.area1
      }
      if (this.params.area2 === '全部') {
        this.params.street = ''
      } else {
        this.params.street = this.params.area2
      }
      if (this.params.area3 === '全部') {
        this.params.community = ''
      } else {
        this.params.community = this.params.area3
      }
      if (this.params.province2 === '全部') {
        this.params.originate_province = ''
      } else {
        this.params.originate_province = this.params.province2
      }
      if (this.params.city2 === '全部') {
        this.params.originate_city = ''
      } else {
        this.params.originate_city = this.params.city2
      }
      if (this.params.follow_person === '全部') {
        this.params.follow_person = ''
      } else {
        this.params.follow_person = this.params.follow_person
      }
      if (this.params.follow_level === '全部') {
        this.params.follow_level = ''
      } else {
        this.params.follow_level = this.params.follow_level
      }
      if (this.params.is_transfer === '全部') {
        this.params.is_transfer = ''
      } else {
        this.params.is_transfer = this.params.is_transfer
      }
      this.params.starttime = date0str(this.dateArr[0])
      this.params.endtime = date0str(this.dateArr[1])
      this.params.jzgl_day = this.jzgl_day
      this.getList()
    },
    getList () {
      // ---调用接口可以打开
      if (this.$route.query.type === '1') {
        this.params.hot = '1'
      } else if (this.$route.query.type === '2') {
        this.params.hot = ''
      } else {
        this.params.hot = ''
      }
      console.log(this.params)
      this.fcDataList = []
      this.loadData = true
      findOlationList(this.params).then(res => {
        let result = res.data
        let that = this
        if (res.data.errcode === 0 || res.data.errcode === 1001) {
          this.fcDataList = res.data.data.results
          this.fcDataList.forEach(function (temp1, index) {
            for (var i = 0; i < that.dictList.length; i++) {
              if (temp1.arrive_address_type === that.dictList[i].value) {
                temp1.arrive_address_type1 = that.dictList[i].label
              }
            }
            // for (var j = 0; j < that.superviseDictList.length; j++) {
            //   if (temp1.supervise_start === that.superviseDictList[j].value) {
            //     temp1.supervise_start1 = that.superviseDictList[j].label
            //   }
            // }
            let tempCardno = temp1.card_no
            if (tempCardno) {
              temp1.card_no1 = `${tempCardno.substring(0, 10)}******${tempCardno.substring(tempCardno.length - 2)}`
            }
            // let tempMobile = temp1.tel
            // if (tempMobile) {
            //  if (tempMobile.length === 11) {
            //    temp1.tel1 = `${tempMobile.substring(0, 3)}****${tempMobile.substring(tempMobile.length - 4)}`
            //  } else {
            //    temp1.tel1 = `${tempMobile.substring(0, 3)}****`
            //  }
            // }
            let tempAddress = temp1.address
            if (tempAddress) {
              temp1.address1 = that.hideCode(tempAddress, 4, 2)
            }
            let tempBirthday = temp1.birthday
            if (tempBirthday) {
              this.datalist[i].birthday = `${tempBirthday.substring(0, 4)}****`
            }
          })
          this.loadData = false
          this.countData.fcnum = res.data.data.totalRecord
          this.params = {
            pageNo: result.data.pageNo,
            pageSize: result.data.pageSize,
            totalPage: result.data.totalPage,
            totalRecord: result.data.totalRecord,
            area: this.params.area,
            street: this.params.street,
            community: this.params.community,
            area1: this.params.area1,
            area2: this.params.area2,
            area3: this.params.area3,
            card_no: this.params.card_no,
            name: this.params.name,
            tel: this.params.tel,
            arrive_address_type: this.params.arrive_address_type,
            hot: this.params.hot,
            isfollow: this.params.isfollow,
            illness_state: this.params.illness_state,
            isout_sheny: this.params.isout_sheny,
            user_type: this.params.user_type,
            state: this.params.state,
            originate_province: this.params.originate_province,
            originate_city: this.params.originate_city,
            province2: this.params.province2,
            city2: this.params.city2,
            // inout_state: this.params.inout_state,
            supervise_start: this.params.supervise_start,
            supervise_timeout: this.params.supervise_timeout,
            states: this.params.states,
            nucleic_acid: this.params.nucleic_acid,
            isolation: this.params.isolation,
            olation_company_code: this.params.olation_company_code,
            follow_person: this.params.follow_person,
            follow_level: this.params.follow_level,
            is_transfer: this.params.is_transfer,
            detection_1_result: this.params.detection_1_result,
            detection_2_result: this.params.detection_2_result,
            risk_groups: this.params.risk_groups,
            is5day1: this.params.is5day1,
            user_control_type1: this.params.user_control_type1,
            user_control_type2: this.params.user_control_type2
          }
          saveparams.info.listjz = this.params
        } else {
          this.loadData = true
          this.$Notice.error({
            title: '查询列表信息失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    chaneProv (index) {
      let temparea = this.params['province' + index]
      if (!temparea) {
        return
      }
      let templist = this.inoutCity.provinceList
      let tempdata = {}
      for (let i = 0; i < templist.length; i++) {
        if (temparea === templist[i].name) {
          tempdata = templist[i]
          break
        }
      }
      this.getCity(tempdata.code, 'city' + index, false)
    },
    getCity (code, listname, flag) {
      getCityList({ code: code }).then(res => {
        if (res.data.errcode === 0) {
          var all = { 'code': '-', 'name': '全部' }
          res.data.data.unshift(all)
          this.inoutCity[listname] = res.data.data
          if (flag) {
            if (this.formInfo.province1) {
              this.chaneProv(1)
            }
            if (this.formInfo.province2) {
              this.chaneProv(2)
            }
          }
        } else {
          this.$Notice.error({ title: '查询失败' })
        }
      })
    },
    getAllList () {
      findOutAllList({}).then(res => {
        if (res.data.errcode === 0 || res.data.errcode === 1001) {
          this.fcAllDataList = JSON.parse(res.data.data.list)
          this.loading = false
          this.$refs.table.exportCsv({
            filename: '疫情监控人员信息',
            columns: this.columns1,
            // columns: this.columns1.filter((col, index) => index < 20),
            data: this.fcAllDataList.map(item => {
              item.来沈时间 = '="' + item.来沈时间 + '"'
              item.填写时间 = '="' + item.填写时间 + '"'
              // if (item.hot === '1') {
              //  item.hot = '发热'
              // } else if (item.hot === '0') {
              //  item.hot = '未发热'
              // }
              // if (item.referral === '0') {
              //  item.referral = '未送诊'
              // } else if (item.referral === '1') {
              //  item.referral = '已送诊'
              // }
              // if (item.isfollow === '1') {
              //  item.isfollow = '是'
              // } else if (item.isfollow === '0') {
              //  item.isfollow = '否'
              // }
              // if (item.arrive_address_type === '1') {
              //  item.arrive_address_type = '湖北武汉'
              // } else if (item.arrive_address_type === '2') {
              //  item.arrive_address_type = '湖北其他城市'
              // } else if (item.arrive_address_type === '4') {
              //  item.arrive_address_type = '武汉海鲜市场'
              // } else if (item.arrive_address_type === '3') {
              //  item.arrive_address_type = '其他省市'
              // }
              return item
            }),
            original: false
          })
          console.log('123123')
        } else {
          this.$Notice.error({
            title: '查询全部人员信息列表失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    findDictList (value) {
      let that = this
      var dic = { 'label': '全部', 'value': '' }
      var dic1 = { 'label': '其他', 'value': '3' }
      getDictList({ type: 'arrive_address_type', pageSize: 30, pageNo: 1 }).then(res => {
        if (res.data.errcode === 0) {
          this.dictList = res.data.data.results
          this.dictList.unshift(dic)
          this.dictList.push(dic1)
          setTimeout(function () {
            that.selectlist()
          }, 500)
        } else {
          this.$Notice.error({ title: '查询失败' })
        }
      })
      getDictList({ type: 'follow_person', pageSize: 60, pageNo: 1 }).then(res => {
        if (res.data.errcode === 0) {
          this.follow_personList = res.data.data.results
          this.follow_personList.unshift(dic)
          setTimeout(function () {
            that.selectlist()
          }, 500)
        } else {
          this.$Notice.error({ title: '查询失败' })
        }
      })
      getDictList({ type: 'follow_person', pageSize: 60, pageNo: 1 }).then(res => {
        if (res.data.errcode === 0) {
          this.followPersonList = res.data.data.results
          this.followPersonList.unshift(dic)
          // setTimeout(function () {
          //   that.selectlist()
          // }, 500)
        } else {
          this.$Notice.error({ title: '查询失败' })
        }
      })
      getDictList({ type: 'is_transfer', pageSize: 30, pageNo: 1 }).then(res => {
        if (res.data.errcode === 0) {
          this.is_transferList = res.data.data.results
          this.is_transferList.unshift(dic)
          setTimeout(function () {
            that.selectlist()
          }, 500)
        } else {
          this.$Notice.error({ title: '查询失败' })
        }
      })
      getDictList({ type: 'supervise_start', pageSize: 30, pageNo: 1 }).then(res => {
        if (res.data.errcode === 0) {
          this.superviseDictList = res.data.data.results
          this.superviseDictList.unshift(dic)
          setTimeout(function () {
            that.selectlist()
          }, 500)
        } else {
          this.$Notice.error({ title: '查询失败' })
        }
      })
      getDictList({ type: 'xgc_usercontroltype', pageSize: 60, pageNo: 1 }).then(res => {
        if (res.data.errcode === 0) {
          this.userControlType1 = res.data.data.results
          this.userControlType1.forEach((item, index) => {
            getDictList({ type: 'xgc_usercontroltype' + item.value, pageSize: 60, pageNo: 1 }).then(res1 => {
              if (res.data.errcode === 0) {
                item.downlist = res1.data.data.results
              } else {
                this.$Notice.error({ title: '查询失败' })
              }
            })
          })
          this.userControlType1.unshift(dic)
          // setTimeout(function () {
          //   that.selectlist()
          // }, 500)
        } else {
          this.$Notice.error({ title: '查询失败' })
        }
      })
    },
    changeuserControlType1 () {
      let param = {
        pageNo: 1,
        pageSize: 60,
        type: 'xgc_usercontroltype' + this.params.user_control_type1
      }
      getDictList(param).then(res => {
        let that = this
        if (res.data.errcode === 0) {
          this.userControlType2 = res.data.data.results
          if (this.userControlType2.length > 0) {
            let dic = { 'label': '全部', 'value': '' }
            that.userControlType2.unshift(dic)
          }
          if (that.params.user_control_type1 === '3') {
            let dic2 = { 'label': '其他', 'value': '3' }
            that.userControlType2.push(dic2)
          }
        } else {
          this.$Notice.error({ title: '查询失败' })
        }
      })
    },
    getCityInfoList (code, index) {
      let param = {
        code: code,
        pageNo: 1,
        pageSize: 200
      }
      getCityList(param).then(res => {
        if (res.data.data) {
          this.cityInfo['list' + index] = res.data.data
          this.change(index)
        } else {
          this.$Notice.error({ title: '查看失败', desc: '查询省市地址信息失败' })
        }
      })
    },
    deleteRow (row) {
      this.$Modal.confirm({
        title: '确认删除该人员信息吗？',
        content: '删除后不可恢复，请确认后再操作！',
        onOk: () => {
          delbyid({ id: row.id }).then(res => {
            if (res.data.errcode === 0) {
              this.getList()
            } else {
              this.$Notice.error({
                title: '删除人员信息失败',
                desc: res.data.errmsg
              })
            }
          })
        }
      })
    },
    moveOut (row) {
      this.modal3 = true
      this.id = row.id
      this.getCompanyList()
    },
    JCGE (row) {
      this.supervise_start = '4'
      this.modal33 = true
      this.id = row.id
      this.getCompanyList()
    },
    JKJC (row) {
      this.supervise_start = '8'
      this.modal22 = true
      this.id = row.id
      this.getCompanyList()
    },
    ShowJKSF (row) {
      this.supervise_start = '15'
      this.modaljksf = true
      this.id = row.id
      this.getCompanyList()
    },
    ZWJKGL (row) {
      this.supervise_start = '14'
      this.modal22 = true
      this.id = row.id
      this.getCompanyList()
    },
    YTS (row) {
      this.modalYTS = true
      this.id = row.id
      this.getCompanyList()
    },
    passCheck (row, type) {
      this.modalCard = true
      this.id = row.id
      if (type === 'paper') {
        this.titleCard = '纸质证明办理'
        this.checkCardTitle = '是 否 已 办 理 纸 质 证 明 ？'
      } else if (type === 'app') {
        this.titleCard = '电子证明办理'
        this.checkCardTitle = '是 否 已 办 理 电 子 证 明 ？'
      }
    },
    quarantine (row) { // 设置隔离状态
      this.modal5 = true
      this.quarantineParam.isolation = row.isolation
      this.id = row.id
      this.quarantineParam.id = this.id
    },
    saveQuarantine () {
      updateuserinfo(this.quarantineParam).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '隔离状态设置成功'
          })
          this.modal5 = false
          this.getList()
        } else {
          this.$Notice.error({
            title: '隔离状态设置失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    okCard () {
      let params = {}
      if (this.titleCard === '纸质证明办理') {
        params = {
          id: this.id,
          paper_card: '1'
        }
      } else if (this.titleCard === '电子证明办理') {
        params = {
          id: this.id,
          app_card: '1'
        }
      }
      updateuserinfo(params).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '证明办理成功'
          })
          this.modal4 = false
          this.getList()
        } else {
          this.$Notice.error({
            title: '证明办理失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    addPerson (what) {
      this.$router.push({ path: '/yi-qing/add-buttons' })
    },
    census () {
      this.$router.push({ path: '/yi-qing/statistics' })
    },
    showdetail (row, what, states) {
      this.$router.push({
        path: '/yi-qing/add-jz',
        query: {
          id: row.id,
          what: what,
          arrive_address_type: row.arrive_address_type,
          user_type: this.params.user_type,
          state: states
        }
      })
    },
    exchange (row) {
      let user_type = ''
      if (this.$route.query.user_type === '1') {
        user_type = '2'
      } else if (this.$route.query.user_type === '2') {
        user_type = '1'
      }
      if (confirm('确定转换该人员信息？')) {
        updateuserinfo({ id: row.id, user_type: user_type, chang_type: '1' }).then(res => {
          if (res.data.errcode === 0) {
            this.$Notice.success({
              title: '',
              desc: '转换人员信息成功'
            })
            this.modal4 = false
            this.getList()
          } else {
            this.$Notice.error({
              title: '转换人员信息失败',
              desc: res.data.errmsg
            })
          }
        })
      }
    },
    temperature (row) {
      this.$router.push({ path: '/yi-qing/fever-list', query: { id: row.id } })
    },
    fever (row) {
      this.modal1 = true
      this.hot = row.hot
      this.id = row.id
    },
    Referral (row) {
      this.findHospitalList()
      this.modal2 = true
      this.referralInfo.referral = row.referral
      this.referralInfo.referral_address = row.referral_address
      this.referralInfo.id = row.id
    },
    leave (row) {
      this.getCityInfoList('', 1)
      this.modal4 = true
      this.modalInfo1.id = row.id
      this.modalInfo1.inout_state = row.inout_state
      this.modalInfo1.isout_sheny_remark = row.isout_sheny_remark
      this.modalInfo1.out_time = row.out_time
      this.modalInfo1.out_type = row.out_type
      this.modalInfo1.out_type_remark = row.out_type_remark
      this.modalInfo1.province1 = row.out_province
      this.modalInfo1.province2 = row.out_city
    },
    ok1 () {
      updateuserinfo(this.referralInfo).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '更改送诊信息成功'
          })
          this.modal1 = false
          this.getList()
        } else {
          this.$Notice.error({
            title: '更改送诊状态失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    ok2 () {
      this.modalInfo1.out_province = this.modalInfo1.province1
      this.modalInfo1.out_city = this.modalInfo1.province2
      this.modalInfo1.out_time = date0str(this.modalInfo1.out_time)
      this.modalInfo1.supervise_start = '3'
      updateuserinfo(this.modalInfo1).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '更改离沈信息成功'
          })
          this.modal4 = false
          this.getList()
        } else {
          this.$Notice.error({
            title: '更改离沈状态失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    ok () {
      updateuserinfo({ id: this.id, hot: this.hot }).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '更改发热状态成功'
          })
          this.modal1 = false
          this.getList()
        } else {
          this.$Notice.error({
            title: '更改发热状态失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    jiechujksf () {
      if (!this.modalStr) {
        this.$Notice.error({
          title: '请选择社区'
        })
        return
      }
      if (!this.transfer_id) {
        this.$Notice.error({
          title: '请填写转运车牌号'
        })
        return
      }
      if (!this.transfer_name) {
        this.$Notice.error({
          title: '请填写转运人员姓名'
        })
        return
      }
      if (!this.transfer_tel) {
        this.$Notice.error({
          title: '请填写转运人员电话'
        })
        return
      }
      if (!this.transfer_time) {
        this.$Notice.error({
          title: '请填写转运时间'
        })
        return
      }
      this.modalInfo = {
        id: this.id,
        company_code: JSON.parse(this.modalStr).code,
        transfer_id: this.transfer_id,
        transfer_name: this.transfer_name,
        transfer_tel: this.transfer_tel,
        transfer_time: date0str(this.transfer_time),
        supervise_start: this.supervise_start
      }
      relieveIsolation(this.modalInfo).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '隔离转健康随访成功'
          })
          this.selectlist()
          this.modaljksf = false
          this.company_code = ''
          this.transfer_id = ''
          this.transfer_name = ''
          this.transfer_tel = ''
          this.transfer_time = ''
        } else {
          this.$Notice.error({
            title: '隔离转健康随访失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    jiechuGL () {
      if (!this.modalStr) {
        this.$Notice.error({
          title: '请选择社区'
        })
        return
      }
      if (!this.transfer_id) {
        this.$Notice.error({
          title: '请填写转运车牌号'
        })
        return
      }
      if (!this.transfer_name) {
        this.$Notice.error({
          title: '请填写转运人员姓名'
        })
        return
      }
      if (!this.transfer_tel) {
        this.$Notice.error({
          title: '请填写转运人员电话'
        })
        return
      }
      if (!this.transfer_time) {
        this.$Notice.error({
          title: '请填写转运时间'
        })
        return
      }
      this.modalInfo = {
        id: this.id,
        company_code: JSON.parse(this.modalStr).code,
        transfer_id: this.transfer_id,
        transfer_name: this.transfer_name,
        transfer_tel: this.transfer_tel,
        transfer_time: date0str(this.transfer_time),
        supervise_start: this.supervise_start
        // supervise_start: '4'
        // in_company: JSON.parse(this.modalStr).code,
        // out_company_name: this.$store.state.user.severUserInfo.company_name,
        // in_company_name: JSON.parse(this.modalStr).sq_name
      }
      relieveIsolation(this.modalInfo).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '隔离转社区健康监测成功'
          })
          this.selectlist()
          this.modal22 = false
          this.company_code = ''
          this.transfer_id = ''
          this.transfer_name = ''
          this.transfer_tel = ''
          this.transfer_time = ''
        } else {
          this.$Notice.error({
            title: '隔离转社区健康监测失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    jiechuGL4 () {
      if (!this.modalStr) {
        this.$Notice.error({
          title: '请选择社区'
        })
        return
      }
      this.modalInfo = {
        id: this.id,
        company_code: JSON.parse(this.modalStr).code,
        supervise_start: '4'
        // in_company: JSON.parse(this.modalStr).code,
        // out_company_name: this.$store.state.user.severUserInfo.company_name,
        // in_company_name: JSON.parse(this.modalStr).sq_name
      }
      relieveIsolation(this.modalInfo).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '隔离转居家隔离成功'
          })
          this.modal33 = false
          this.selectlist()
        } else {
          this.$Notice.error({
            title: '隔离转居家隔离失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    yutuisong () {
      if (!this.modalStr) {
        this.$Notice.error({
          title: '请选择社区'
        })
        return
      }
      this.modalInfo = {
        id: this.id,
        company_code: JSON.parse(this.modalStr).code
      }
      saveBeforehandSendInfo(this.modalInfo).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '预推送成功'
          })
          this.modalYTS = false
          this.company_code = ''
        } else {
          this.$Notice.error({
            title: '预推送失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    saveCompany () {
      console.log(JSON.parse(this.modalStr))
      this.modalInfo = {
        user_id: this.id,
        in_company: JSON.parse(this.modalStr).code,
        out_company_name: this.$store.state.user.severUserInfo.company_name,
        in_company_name: JSON.parse(this.modalStr).sq_name
      }
      createOutApplu(this.modalInfo).then(res => {
        if (res.data.errcode === 0) {
          this.$Notice.success({
            title: '',
            desc: '迁出人员信息成功'
          })
          this.modal1 = false
          this.getList()
        } else {
          this.$Notice.error({
            title: '迁出人员信息失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    cancel () {
      this.modal1 = false
      this.modal2 = false
      this.modal3 = false
      this.modal4 = false
      this.modal5 = false
      this.modalCard = false
    },
    perChange (index) {
      let temparea = this.params['area' + index]
      if (!temparea) {
        return
      }
      let templist = this.addressInfo['list' + index]
      let tempdata = {}
      for (let i = 0; i < templist.length; i++) {
        if (temparea === templist[i].title) {
          tempdata = templist[i]
        }
      }
      this.getDownAddress(tempdata.id, index + 1)
    },
    change (index) {
      console.log(index, '1111')
      let temparea = this.modalInfo1['province' + index]
      console.log(temparea, '12121')
      if (!temparea) {
        return
      }
      let templist = this.cityInfo['list' + index]
      console.log(templist, '123313123213')
      let tempdata = {}
      for (let i = 0; i < templist.length; i++) {
        if (temparea === templist[i].name) {
          tempdata = templist[i]
        }
      }
      this.getCityInfoList(tempdata.code, index + 1)
    },
    // 下拉搜索框的级联查询
    getDownAddress (pid, index) {
      let param = {
        pid: pid,
        pageNo: 1,
        pageSize: 200
      }
      grid_downlist(param).then(res => {
        if (res.data.data) {
          this.addressInfo['list' + index] = res.data.data.results
          let obj = {
            id: '',
            level: '',
            mapjson: '',
            path: '',
            pid: 0,
            title: '全部',
            company_code: ''
          }
          this.addressInfo['list' + index].unshift(obj)
          this.perChange(index)
        } else {
          this.$Notice.error({ title: '查看失败', desc: '查询地址信息失败' })
        }
      })
    },
    getCompanyList () {
      getAllUserByMZNotNCList({}).then(res => {
        if (res.data.errcode === 0) {
          this.company_list = res.data.data
        } else {
          this.$Notice.error({
            title: '获取社区列表失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    findHospitalList () {
      findAllHospitalList({}).then(res => {
        if (res.data.errcode === 0) {
          this.hospital_list = res.data.data
        } else {
          this.$Notice.error({
            title: '获取定点医院列表失败',
            desc: res.data.errmsg
          })
        }
      })
    },
    uploadImgAll (row, what) {
      this.row = row
      this.$refs.imgService.modelAction()
    },
    pageSizeChange (e) {
      this.params.pageSize = e
      this.selectlist(this.params.pageNo)
    },
    chuanSongAction () {
      this.$refs.turnPeopleModel.modelAction()
    },
    // exportData (type) {
    //   if (this.fcAllDataList.length === 0) { // 没有数据需加载接口
    //     this.loading = true
    //     this.getAllList()
    //   } else {
    //     this.loading = false
    //     this.$refs.table.exportCsv({
    //       filename: '疫情监控人员信息',
    //       columns: this.columns1,
    //       // columns: this.columns1.filter((col, index) => index < 20),
    //       data: this.fcAllDataList.map(item => {
    //         // item.来沈时间 = '="' + item.来沈时间 + '"'
    //         // item.填写时间 = '="' + item.填写时间 + '"'
    //         // if (item.hot === '1') {
    //         //  item.hot = '发热'
    //         // } else if (item.hot === '0') {
    //         //  item.hot = '未发热'
    //         // }
    //         // if (item.referral === '0') {
    //         //  item.referral = '未送诊'
    //         // } else if (item.referral === '1') {
    //         //  item.referral = '已送诊'
    //         // }
    //         // if (item.isfollow === '1') {
    //         //  item.isfollow = '是'
    //         // } else if (item.isfollow === '0') {
    //         //  item.isfollow = '否'
    //         // }
    //         // if (item.arrive_address_type === '1') {
    //         //  item.arrive_address_type = '湖北武汉'
    //         // } else if (item.arrive_address_type === '2') {
    //         //  item.arrive_address_type = '湖北其他城市'
    //         // } else if (item.arrive_address_type === '4') {
    //         //  item.arrive_address_type = '武汉海鲜市场'
    //         // } else if (item.arrive_address_type === '3') {
    //         //  item.arrive_address_type = '其他省市'
    //         // }
    //         return item
    //       }),
    //       original: false
    //     })
    //   }
    // },
    importExcel () {

    },
    hideCode (str, frontLen, endLen) {
      var len = str.length - frontLen - endLen
      var xing = ''
      for (var i = 0; i < len; i++) {
        xing += '*'
      }
      return str.substring(0, frontLen) + xing + str.substring(str.length - endLen)
    },
    cleanQuery () {
      this.params = { name: '', type: '', pageNo: 1, pageSize: 10, totalRecord: 0, state: '', area1: '', area2: '', area3: '', arrive_address_type: '', hot: '', isfollow: '', user_type: this.$route.query.user_type, inout_state: '', originate_province: '', originate_city: '', states: '', nucleic_acid: '', isolation: '', supervise_start: '' }
      this.selectlist(1)
    }
  },
  mounted () {
    if (saveparams.info.listjz !== undefined) {
      this.params = saveparams.info.listjz
    }
    this.params.user_type = this.$route.query.user_type
    this.params.states = this.$route.query.states
    console.log(this.$route.query.user_type, 'dfsfafsd')
    this.findDictList()
    // this.selectlist()
    this.getDownAddress(0, 1)
    this.getCity(null, 'provinceList', false)
    // this.getCompanyList()
  }
}
</script>

<style scoped>
    .page_style {
        margin: 20px 5px;
    }

    .input-frame {
        width: 120px;
        margin-right: 10px;
    }

    .house-list > .group {
        background: white;
        padding: 10px;
        margin-top: 10px;
    }

    .house-list > .group > .item {
        border-bottom: 1px solid #f5f5f5;
        padding: 10px 0;
    }

    .house-list > .group > .item .top {
        display: flex;
        justify-content: space-between;
        margin-bottom: 5px;
    }

    .house-list > .group > .item .title {
        font-size: 14px;
        color: #333333;
    }

    .house-list > .group > .item .address {
        font-size: 12px;
        color: gray;
        display: flex;
        align-items: center;
    }

    .house-list > .group > .item .detail {
        font-size: 12px;
        color: dodgerblue;
    }

    .opt-area-02 {
        display: flex;
        align-items: center;
        flex-direction: column;
        border: 1px solid #abdcff;
        background-color: #f0faff;
        padding: 8px 16px 8px 16px;
        border-radius: 4px;
        margin-bottom: 10px;
    }

    .opt-area-02 .right-con {
        width: 100%;
        margin-top: 5px;
        display: flex;
    }

    .opt-area-02 .left-con {
        font-size: 14px;
        width: 100%;
    }

    .opt-area-02 .left-con span {
        font-weight: bold;
    }

    .opt-area-02 .right-con input {
        width: 150px;
        margin-right: 10px;
    }

    .opt-area-02 .right-con .input-frame {
        width: 200px;
        margin-right: 10px;
    }

    .table-action-btn {
        margin-right: 3px;
    }

    .container >>> .ivu-btn-small {
        height: 24px;
        padding: 0 5px;
        font-size: 12px;
        border-radius: 3px;
    }

    .btn-action {
        margin-bottom: 10px;
    }

    .mp10 {
        margin-right: 10px;
    }
    .title-style {
      color: red;
    }
    .mb20 {
      margin-bottom: 20px;
    }
    .mt20 {
      margin-top: 20px;
    }
    .ivu-table-row {
      height: 57px;
    }
  .ivu-form-item-label {
    margin-top: 8px;
  }
    .demo-spin-icon-load{
      animation: ani-demo-spin 1s linear infinite;
    }
    @keyframes ani-demo-spin {
      from { transform: rotate(0deg);}
      50%  { transform: rotate(180deg);}
      to   { transform: rotate(360deg);}
    }
    .demo-spin-col{
      height: 100px;
      position: relative;
      /*border: 1px solid #eee;*/
    }
    .red-star {
    font-family: SimSun;
    color: #f00;
    margin-right: 4px;
  }
</style>
